#include "Output.h"

#include "GameLib/Framework.h"

void Output::PrintMap(const Map& MapInstance)
{
    unsigned* VRam = GameLib::Framework::instance().videoMemory();
    int WindowWidth = GameLib::Framework::instance().width();

    unsigned Row = MapInstance.size();
    unsigned Col = MapInstance[0].size();
    for (unsigned i = 0; i < Row; ++i)
    {
        for (unsigned j = 0; j < Col; ++j)
        {
            VRam[i * Row + j] = ConvertToPixelColor(MapInstance[i][j]);
        }
        std::cout << std::endl;
    }
}

unsigned Output::ConvertToPixelColor(ObjectType Type)
{
    switch (Type)
    {
    case EMPTY:
        return gEmptySymbol;
    case WALL:
        return gWallSymbol;
    case BOX:
        return gBoxSymbol;
    case PLAYER:
        return gPlayerSymbol;
    case ENDZONE:
        return gEndZoneSymbol;
    case BOX_AT_ENDZONE:
        return gBoxAtEndZoneSymbol;
    default:
        return 0;
    }
}
